package com.javaenzk.wfx.manager.controller;


import com.javaenzk.wfx.manager.service.IWxbGoodService;
import com.javaenzk.wfx.manager.util.ResultJson;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/customer")
public class CustomerController {

    @Resource
    private IWxbGoodService wxbGoodService;

    @RequestMapping("/login")
    @ResponseBody
    public ResultJson loginBy(String username, String password){

        try {
            SecurityUtils.getSubject().login(new UsernamePasswordToken(username,password));
            return ResultJson.createSuccessResult(null);
        }
        catch (Exception e){
            e.printStackTrace();
           return ResultJson.createFailResult("1","error");
        }

    }


}
